package edu.qd.learn.newchapter.chapter06;

import java.util.ArrayList;
import java.util.List;

/**
 * 厨子
 *  Cook 线程类来进行启动
 * @author 布衣
 */
public class Cook extends Thread {

    public void createBread(){
       Store.list.add("面包");
    }

    public void run(){
        while(true){
            if(Store.list.size() < 100){
                createBread();
            }
        }
    }

    public static void main(String[] args) {
        Cook c = new Cook();
        c.start();
        System.out.println(Store.list);
        System.out.println(Store.list.size());
    }

}
